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

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

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

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

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

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

e = A("e")
h = B("h")
k = C("k")
d = D("d")
c = E("c")
m = F("m")
a = E("a")
b = F("b")
f = E("f")
i = D("i")

e.s = h
e.q = a
e.o = k
e.w = k
e.v = c
e.r = f
h.w = k
k.p = a
k.w = e
k.y = d
k.o = h
d.q = e
d.y = e
d.s = i
d.p = m
c.t = f
m.s = f
m.o = h
m.z = b
m.y = d
m.x = e
a.t = c
b.s = c
b.o = h
b.z = m
b.y = i
b.x = e
f.t = a
i.q = e
i.y = e
i.s = d
i.p = m
assert a.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.o: C = None
        self.v: E = None
        self.w: C = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

e = A("e")
h = B("h")
k = C("k")
d = D("d")
c = E("c")
m = F("m")
a = E("a")
b = F("b")
f = E("f")
i = D("i")

e.s = h
e.q = a
e.o = k
e.w = k
e.v = c
e.r = f
h.w = k
k.p = a
k.w = e
k.y = d
k.o = h
d.q = e
d.y = e
d.s = i
d.p = m
c.t = f
m.s = f
m.o = h
m.z = b
m.y = d
m.x = e
a.t = c
b.s = c
b.o = h
b.z = m
b.y = i
b.x = e
f.t = a
i.q = e
i.y = e
i.s = d
i.p = m
assert a.t.t.t.t.t.t.t.txt == "c"