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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: G = None
        self.x: A = None
        self.r: G = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.v: D = None
        self.x: C = None
        self.z: G = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.u: D = None
        self.x: D = None
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: G = None
        self.x: A = None
        self.r: G = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.v: D = None
        self.x: C = None
        self.z: G = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: F = None
        self.u: D = None
        self.x: D = None
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

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