class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.r: C = None
        self.q: H = None
        self.t: H = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.y: E = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.r: C = None
        self.q: H = None
        self.t: H = None
        self.z: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.y: E = None
        self.s: G = None
        self.u: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.txt = txt

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

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