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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: E = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.o: C = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.u: E = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: A = None
        self.o: C = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

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

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

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