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

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

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

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

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

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

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

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

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

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

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

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

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

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

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