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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.u: D = None
        self.t: A = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.u: D = None
        self.t: A = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

j.p = c
c.w = j
c.t = j
c.x = m
c.u = e
c.v = e
c.p = d
i.t = c
i.x = c
i.q = m
i.r = g
e.v = c
e.o = m
e.t = j
f.p = d
f.o = m
m.t = j
m.u = j
m.s = h
m.o = f
h.z = g
h.u = j
h.r = m
h.q = l
d.p = f
d.o = m
g.t = c
g.x = c
g.q = m
g.r = i
l.z = g
l.u = j
l.r = m
l.q = h
assert d.o.o.o.txt == "m"