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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
e = C("e")
m = D("m")
f = E("f")
j = F("j")
i = A("i")
h = B("h")
g = B("g")
d = B("d")

c.o = f
l.z = e
l.v = e
l.y = m
l.o = f
l.p = f
l.t = j
e.o = i
e.q = m
m.t = i
m.w = f
m.z = f
f.o = c
j.t = m
i.o = f
h.z = e
h.v = e
h.y = m
h.o = f
h.p = f
h.t = j
g.z = e
g.v = e
g.y = m
g.o = f
g.p = f
g.t = j
d.z = e
d.v = e
d.y = m
d.o = f
d.p = f
d.t = j
assert j.t.w.o.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
e = C("e")
m = D("m")
f = E("f")
j = F("j")
i = A("i")
h = B("h")
g = B("g")
d = B("d")

c.o = f
l.z = e
l.v = e
l.y = m
l.o = f
l.p = f
l.t = j
e.o = i
e.q = m
m.t = i
m.w = f
m.z = f
f.o = c
j.t = m
i.o = f
h.z = e
h.v = e
h.y = m
h.o = f
h.p = f
h.t = j
g.z = e
g.v = e
g.y = m
g.o = f
g.p = f
g.t = j
d.z = e
d.v = e
d.y = m
d.o = f
d.p = f
d.t = j
assert j.t.w.o.o.o.o.o.o.o.txt == "c"