class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: H = None
        self.u: D = None
        self.z: H = None
        self.t: H = None
        self.y: E = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.s: F = None
        self.y: A = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.w: I = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: B = None
        self.x: I = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: H = None
        self.s: B = None
        self.x: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: G = None
        self.p: G = None
        self.x: E = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.s: F = None
        self.y: A = None
        self.v: A = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.w: I = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: B = None
        self.x: I = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: H = None
        self.s: B = None
        self.x: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: G = None
        self.p: G = None
        self.x: E = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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