class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.q: F = 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.v: A = None
        self.w: E = None
        self.r: G = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.q: C = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

l.o = d
l.r = a
l.q = m
g.y = l
j.v = l
j.w = f
j.r = a
j.o = a
j.s = m
b.z = j
b.s = j
b.q = f
b.r = c
f.s = c
f.x = m
f.w = m
f.z = g
m.z = j
m.t = j
m.q = j
m.v = j
m.x = j
a.r = j
a.z = j
a.x = c
a.t = l
a.p = b
c.s = f
c.x = m
c.w = m
c.z = d
d.y = l
assert l.o.y.o.y.o.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.q: F = 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.v: A = None
        self.w: E = None
        self.r: G = None
        self.o: G = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: C = None
        self.q: C = None
        self.v: C = None
        self.x: C = None
        self.txt = txt

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

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

l.o = d
l.r = a
l.q = m
g.y = l
j.v = l
j.w = f
j.r = a
j.o = a
j.s = m
b.z = j
b.s = j
b.q = f
b.r = c
f.s = c
f.x = m
f.w = m
f.z = g
m.z = j
m.t = j
m.q = j
m.v = j
m.x = j
a.r = j
a.z = j
a.x = c
a.t = l
a.p = b
c.s = f
c.x = m
c.w = m
c.z = d
d.y = l
assert l.o.y.o.y.o.y.o.y.txt == "l"