class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.u: F = None
        self.x: F = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.t: G = None
        self.r: B = None
        self.s: G = None
        self.u: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.s: B = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
b = D("b")
a = E("a")
j = F("j")
g = G("g")
l = H("l")
c = A("c")
f = D("f")

n.v = g
n.q = g
n.r = c
d.r = j
d.u = j
d.x = j
d.z = a
d.o = m
d.q = m
m.s = d
b.q = d
b.r = d
b.x = f
b.u = f
b.t = g
b.s = g
b.p = j
a.x = l
a.w = l
j.u = b
g.r = d
g.t = d
l.r = g
l.w = a
l.s = d
l.x = j
l.o = n
c.v = g
c.q = g
c.r = n
f.q = d
f.r = d
f.x = b
f.u = b
f.t = g
f.s = g
f.p = j
assert j.u.t.r.o.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.u: F = None
        self.x: F = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: D = None
        self.t: G = None
        self.r: B = None
        self.s: G = None
        self.u: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.s: B = None
        self.x: F = None
        self.o: A = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
b = D("b")
a = E("a")
j = F("j")
g = G("g")
l = H("l")
c = A("c")
f = D("f")

n.v = g
n.q = g
n.r = c
d.r = j
d.u = j
d.x = j
d.z = a
d.o = m
d.q = m
m.s = d
b.q = d
b.r = d
b.x = f
b.u = f
b.t = g
b.s = g
b.p = j
a.x = l
a.w = l
j.u = b
g.r = d
g.t = d
l.r = g
l.w = a
l.s = d
l.x = j
l.o = n
c.v = g
c.q = g
c.r = n
f.q = d
f.r = d
f.x = b
f.u = b
f.t = g
f.s = g
f.p = j
assert j.u.t.r.o.s.o.s.txt == "d"