class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

c = A("c")
j = B("j")
k = C("k")
f = D("f")
i = E("i")
e = F("e")
n = D("n")
g = A("g")
l = B("l")

c.u = j
c.q = f
j.z = e
k.w = i
f.p = g
i.r = j
i.w = e
e.r = i
e.z = i
e.y = k
e.p = g
e.u = c
e.x = n
n.p = c
g.u = l
g.q = n
l.z = e
assert i.r.z.p.q.p.q.p.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

c = A("c")
j = B("j")
k = C("k")
f = D("f")
i = E("i")
e = F("e")
n = D("n")
g = A("g")
l = B("l")

c.u = j
c.q = f
j.z = e
k.w = i
f.p = g
i.r = j
i.w = e
e.r = i
e.z = i
e.y = k
e.p = g
e.u = c
e.x = n
n.p = c
g.u = l
g.q = n
l.z = e
assert i.r.z.p.q.p.q.p.u.z.txt == "e"