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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.o: C = None
        self.x: G = None
        self.s: E = None
        self.r: C = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.z: C = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.w: B = None
        self.z: A = None
        self.x: B = None
        self.t: G = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

m = A("m")
n = B("n")
j = C("j")
k = D("k")
e = E("e")
b = F("b")
d = G("d")
g = H("g")
f = G("f")
h = B("h")

m.t = k
m.p = k
m.y = h
m.x = h
m.u = h
m.s = b
m.q = j
n.p = j
n.o = j
n.r = j
n.z = h
n.x = d
n.s = e
n.t = f
n.y = g
j.q = e
k.v = j
k.q = e
e.s = k
b.x = j
b.o = k
b.z = k
d.x = h
d.s = g
d.z = j
d.v = j
d.y = b
g.r = m
g.z = m
g.s = n
g.x = n
g.p = n
g.w = h
g.t = d
g.u = j
f.x = h
f.s = g
f.z = j
f.v = j
f.y = b
h.p = j
h.o = j
h.r = j
h.z = n
h.x = f
h.t = f
h.s = e
h.y = g
assert b.x.q.s.v.q.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: B = None
        self.s: F = None
        self.x: B = None
        self.q: C = None
        self.u: B = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.o: C = None
        self.x: G = None
        self.s: E = None
        self.r: C = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: H = None
        self.z: C = None
        self.y: F = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.w: B = None
        self.z: A = None
        self.x: B = None
        self.t: G = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

m = A("m")
n = B("n")
j = C("j")
k = D("k")
e = E("e")
b = F("b")
d = G("d")
g = H("g")
f = G("f")
h = B("h")

m.t = k
m.p = k
m.y = h
m.x = h
m.u = h
m.s = b
m.q = j
n.p = j
n.o = j
n.r = j
n.z = h
n.x = d
n.s = e
n.t = f
n.y = g
j.q = e
k.v = j
k.q = e
e.s = k
b.x = j
b.o = k
b.z = k
d.x = h
d.s = g
d.z = j
d.v = j
d.y = b
g.r = m
g.z = m
g.s = n
g.x = n
g.p = n
g.w = h
g.t = d
g.u = j
f.x = h
f.s = g
f.z = j
f.v = j
f.y = b
h.p = j
h.o = j
h.r = j
h.z = n
h.x = f
h.t = f
h.s = e
h.y = g
assert b.x.q.s.v.q.s.v.txt == "j"