class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.s: D = None
        self.r: E = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.u: C = None
        self.q: B = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: C = None
        self.u: C = None
        self.q: B = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

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

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

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

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