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

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

class C:
    def __init__(self, txt: str):
        self.v: 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.t: A = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: 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.t: A = None
        self.v: B = None
        self.txt = txt

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

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

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