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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.q: C = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.y: C = None
        self.t: E = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.y: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.q: C = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.y: C = None
        self.t: E = None
        self.q: H = None
        self.z: A = None
        self.txt = txt

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

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

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