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

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

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

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

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

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

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

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

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

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

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

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

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

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

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