class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: D = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: F = None
        self.q: G = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: G = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: F = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.u: E = None
        self.s: C = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.y: F = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: F = None
        self.q: G = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: G = None
        self.q: F = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: F = None
        self.o: A = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: F = None
        self.u: E = None
        self.s: C = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.y: F = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

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

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