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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.v: F = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.v: F = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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