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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: E = None
        self.u: D = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: C = None
        self.t: F = None
        self.s: F = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: E = None
        self.u: D = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: C = None
        self.t: F = None
        self.s: F = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

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

k.w = n
k.z = c
k.p = d
m.s = l
m.u = l
m.x = f
m.t = f
m.p = f
i.r = m
i.w = n
l.q = i
l.s = n
f.u = b
f.z = b
f.p = i
f.t = h
f.s = h
f.o = c
b.q = l
b.p = h
c.q = i
c.s = n
d.u = h
d.t = h
d.s = h
d.p = i
d.o = c
d.z = b
n.w = k
n.z = l
n.p = f
h.q = l
h.p = b
assert k.z.q.r.txt == "m"