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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

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

b.o = m
a.t = k
a.x = k
a.v = g
a.q = c
a.r = m
c.z = k
c.w = b
c.q = l
j.x = a
j.z = k
j.w = e
g.q = c
g.w = l
g.z = j
g.o = j
k.q = j
k.u = j
k.r = e
e.q = j
e.u = j
e.r = k
l.q = c
l.w = g
l.z = j
l.o = j
m.o = b
assert j.w.q.x.r.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: E = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

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

b.o = m
a.t = k
a.x = k
a.v = g
a.q = c
a.r = m
c.z = k
c.w = b
c.q = l
j.x = a
j.z = k
j.w = e
g.q = c
g.w = l
g.z = j
g.o = j
k.q = j
k.u = j
k.r = e
e.q = j
e.u = j
e.r = k
l.q = c
l.w = g
l.z = j
l.o = j
m.o = b
assert j.w.q.x.r.o.o.o.o.o.txt == "b"