class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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