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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: B = None
        self.v: F = None
        self.o: A = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.u: B = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

l = A("l")
m = B("m")
k = C("k")
n = D("n")
b = E("b")
e = F("e")
c = C("c")
g = C("g")

l.u = e
m.y = b
k.s = b
k.r = m
k.v = e
k.o = l
k.t = l
k.w = l
n.p = e
n.o = c
b.x = e
b.y = n
b.z = g
e.z = l
e.v = l
e.s = g
e.u = m
e.y = m
c.s = b
c.r = m
c.v = e
c.o = l
c.t = l
c.w = l
g.s = b
g.r = m
g.v = e
g.o = l
g.t = l
g.w = l
assert k.r.y.y.p.y.y.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: B = None
        self.v: F = None
        self.o: A = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.u: B = None
        self.v: A = None
        self.y: B = None
        self.txt = txt

l = A("l")
m = B("m")
k = C("k")
n = D("n")
b = E("b")
e = F("e")
c = C("c")
g = C("g")

l.u = e
m.y = b
k.s = b
k.r = m
k.v = e
k.o = l
k.t = l
k.w = l
n.p = e
n.o = c
b.x = e
b.y = n
b.z = g
e.z = l
e.v = l
e.s = g
e.u = m
e.y = m
c.s = b
c.r = m
c.v = e
c.o = l
c.t = l
c.w = l
g.s = b
g.r = m
g.v = e
g.o = l
g.t = l
g.w = l
assert k.r.y.y.p.y.y.z.o.txt == "l"