class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.r: F = None
        self.t: F = None
        self.p: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
a = C("a")
b = D("b")
m = E("m")
n = F("n")
d = B("d")

c.w = n
c.r = n
c.t = n
c.o = n
c.z = m
c.p = m
j.o = d
j.w = m
j.x = m
j.u = m
a.o = n
a.r = m
b.w = j
m.u = d
m.o = a
n.w = b
n.o = m
n.t = m
d.o = j
d.w = m
d.x = m
d.u = m
assert n.w.w.o.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.r: F = None
        self.t: F = None
        self.p: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: E = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
a = C("a")
b = D("b")
m = E("m")
n = F("n")
d = B("d")

c.w = n
c.r = n
c.t = n
c.o = n
c.z = m
c.p = m
j.o = d
j.w = m
j.x = m
j.u = m
a.o = n
a.r = m
b.w = j
m.u = d
m.o = a
n.w = b
n.o = m
n.t = m
d.o = j
d.w = m
d.x = m
d.u = m
assert n.w.w.o.o.w.u.txt == "d"