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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.z: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.q: C = None
        self.w: B = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.x: E = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

g = A("g")
h = B("h")
e = C("e")
l = D("l")
b = E("b")
n = F("n")

g.t = n
g.x = h
h.s = n
e.x = h
e.r = h
e.z = b
e.v = b
e.s = b
l.x = h
l.w = h
l.z = e
l.q = e
l.s = b
b.p = g
n.u = b
n.x = b
n.t = l
n.w = e
n.z = g
assert e.r.s.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: B = None
        self.z: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: C = None
        self.q: C = None
        self.w: B = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.x: E = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

g = A("g")
h = B("h")
e = C("e")
l = D("l")
b = E("b")
n = F("n")

g.t = n
g.x = h
h.s = n
e.x = h
e.r = h
e.z = b
e.v = b
e.s = b
l.x = h
l.w = h
l.z = e
l.q = e
l.s = b
b.p = g
n.u = b
n.x = b
n.t = l
n.w = e
n.z = g
assert e.r.s.t.z.txt == "e"