class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.p: B = None
        self.v: E = None
        self.z: B = None
        self.txt = txt

d = A("d")
a = B("a")
k = C("k")
h = D("h")
m = E("m")
n = F("n")
l = E("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.p: B = None
        self.v: E = None
        self.z: B = None
        self.txt = txt

d = A("d")
a = B("a")
k = C("k")
h = D("h")
m = E("m")
n = F("n")
l = E("l")

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