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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: A = None
        self.s: D = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: A = None
        self.s: D = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

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

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