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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.q: I = None
        self.p: A = None
        self.u: E = None
        self.s: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.q: I = None
        self.v: J = None
        self.y: I = None
        self.w: A = None
        self.r: D = None
        self.x: I = None
        self.t: G = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: I = None
        self.w: I = None
        self.r: C = None
        self.y: B = None
        self.x: I = None
        self.q: J = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.y: F = None
        self.u: F = None
        self.s: B = None
        self.q: H = None
        self.txt = txt

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

l = A("l")
d = B("d")
g = C("g")
n = D("n")
f = E("f")
h = F("h")
k = G("k")
c = H("c")
e = I("e")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.q: I = None
        self.p: A = None
        self.u: E = None
        self.s: F = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.q: I = None
        self.v: J = None
        self.y: I = None
        self.w: A = None
        self.r: D = None
        self.x: I = None
        self.t: G = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: A = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: I = None
        self.w: I = None
        self.r: C = None
        self.y: B = None
        self.x: I = None
        self.q: J = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.y: F = None
        self.u: F = None
        self.s: B = None
        self.q: H = None
        self.txt = txt

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

l = A("l")
d = B("d")
g = C("g")
n = D("n")
f = E("f")
h = F("h")
k = G("k")
c = H("c")
e = I("e")
m = J("m")

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