class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.w: D = None
        self.r: H = None
        self.v: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: J = None
        self.y: G = None
        self.w: E = None
        self.p: I = None
        self.z: D = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: C = None
        self.p: B = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: H = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: J = None
        self.y: G = None
        self.w: E = None
        self.p: I = None
        self.z: D = None
        self.r: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: C = None
        self.p: B = None
        self.u: D = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: H = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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