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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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

k.r = d
k.y = h
k.z = e
a.s = c
a.p = m
e.p = k
e.t = h
e.x = m
e.u = m
e.w = a
m.o = c
m.x = j
m.y = k
h.t = m
h.p = n
h.u = n
h.q = e
h.s = k
j.q = e
b.s = k
b.p = m
n.s = k
n.p = m
d.q = e
c.r = d
c.y = h
c.z = e
assert j.q.p.z.t.p.s.z.x.y.txt == "k"