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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
m = C("m")
f = D("f")
h = E("h")
k = B("k")
j = E("j")
i = D("i")
b = B("b")
c = B("c")

l.p = f
l.v = f
l.q = m
l.z = m
l.t = h
e.q = l
e.w = l
e.z = m
e.v = h
m.w = c
m.y = l
m.r = l
f.v = i
f.u = j
h.r = j
k.q = l
k.w = l
k.z = m
k.v = h
j.r = h
i.v = f
i.u = j
b.q = l
b.w = l
b.z = m
b.v = h
c.q = l
c.w = l
c.z = m
c.v = j
assert j.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: C = None
        self.z: C = None
        self.v: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
m = C("m")
f = D("f")
h = E("h")
k = B("k")
j = E("j")
i = D("i")
b = B("b")
c = B("c")

l.p = f
l.v = f
l.q = m
l.z = m
l.t = h
e.q = l
e.w = l
e.z = m
e.v = h
m.w = c
m.y = l
m.r = l
f.v = i
f.u = j
h.r = j
k.q = l
k.w = l
k.z = m
k.v = h
j.r = h
i.v = f
i.u = j
b.q = l
b.w = l
b.z = m
b.v = h
c.q = l
c.w = l
c.z = m
c.v = j
assert j.r.r.r.r.txt == "j"