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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.r: A = None
        self.p: C = None
        self.v: I = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.r: E = None
        self.o: C = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.v: H = None
        self.o: D = None
        self.t: H = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.v: E = None
        self.z: A = None
        self.w: I = None
        self.t: C = None
        self.x: C = None
        self.q: A = None
        self.s: C = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: G = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: J = None
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: H = None
        self.r: A = None
        self.p: C = None
        self.v: I = None
        self.y: G = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.r: E = None
        self.o: C = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.v: H = None
        self.o: D = None
        self.t: H = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: D = None
        self.v: E = None
        self.z: A = None
        self.w: I = None
        self.t: C = None
        self.x: C = None
        self.q: A = None
        self.s: C = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: G = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: J = None
        self.o: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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