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

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

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

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

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

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

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

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

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

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

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

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

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

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

f.t = e
f.u = i
f.y = i
f.v = i
f.w = a
m.p = i
i.x = c
i.w = f
i.y = f
i.z = j
c.o = m
c.t = m
j.y = c
j.v = c
j.t = m
j.z = m
j.p = i
j.s = f
l.w = f
l.u = f
l.y = e
l.q = i
e.w = f
e.u = f
e.y = l
e.q = i
a.o = m
a.t = m
assert a.t.p.z.t.p.w.w.t.txt == "m"