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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: F = None
        self.r: D = None
        self.p: F = None
        self.y: D = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

l = A("l")
a = B("a")
f = C("f")
c = D("c")
n = E("n")
j = F("j")
d = G("d")
m = H("m")

l.r = n
l.z = j
a.o = c
a.r = c
a.y = c
a.v = j
a.p = j
a.t = l
f.o = l
f.q = l
f.s = a
f.p = n
f.v = n
f.t = m
c.r = l
c.u = m
n.p = l
j.z = a
j.v = m
j.r = d
d.u = n
m.s = j
m.u = a
m.q = a
assert l.r.p.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: F = None
        self.r: D = None
        self.p: F = None
        self.y: D = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

l = A("l")
a = B("a")
f = C("f")
c = D("c")
n = E("n")
j = F("j")
d = G("d")
m = H("m")

l.r = n
l.z = j
a.o = c
a.r = c
a.y = c
a.v = j
a.p = j
a.t = l
f.o = l
f.q = l
f.s = a
f.p = n
f.v = n
f.t = m
c.r = l
c.u = m
n.p = l
j.z = a
j.v = m
j.r = d
d.u = n
m.s = j
m.u = a
m.q = a
assert l.r.p.r.p.txt == "l"