class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.p: F = None
        self.x: B = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.x: D = None
        self.txt = txt

b = A("b")
d = B("d")
h = C("h")
j = D("j")
n = E("n")
l = F("l")
c = G("c")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.t: A = None
        self.x: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.p: F = None
        self.x: B = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.v: A = None
        self.r: A = None
        self.x: D = None
        self.txt = txt

b = A("b")
d = B("d")
h = C("h")
j = D("j")
n = E("n")
l = F("l")
c = G("c")

b.x = l
d.r = j
d.z = h
d.x = h
d.t = b
h.o = n
h.u = l
h.y = l
h.x = d
h.r = j
j.t = b
j.q = b
j.s = l
j.r = l
n.v = c
n.s = l
n.p = l
n.x = d
n.o = b
n.u = j
l.z = c
l.u = d
c.u = n
c.o = n
c.v = b
c.r = b
c.x = j
assert h.r.t.x.u.r.t.x.txt == "l"