class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: E = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: D = None
        self.x: H = None
        self.y: E = None
        self.r: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: D = None
        self.z: D = None
        self.x: J = None
        self.u: I = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: J = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: D = None
        self.x: H = None
        self.y: E = None
        self.r: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: D = None
        self.z: D = None
        self.x: J = None
        self.u: I = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: J = None
        self.u: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.v: E = None
        self.txt = txt

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

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