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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: A = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

m.s = c
l.w = g
l.q = m
l.v = e
l.x = d
d.u = k
i.q = b
n.y = c
e.w = l
e.x = m
e.o = c
e.t = n
b.q = i
k.u = d
g.w = l
g.q = m
g.v = e
g.x = d
c.y = n
assert d.u.u.u.u.u.u.u.u.txt == "d"