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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: A = None
        self.x: B = None
        self.t: J = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: I = None
        self.t: D = None
        self.s: G = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.p: D = None
        self.r: B = None
        self.t: J = None
        self.x: B = None
        self.z: G = None
        self.w: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: A = None
        self.x: B = None
        self.t: J = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: I = None
        self.t: D = None
        self.s: G = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.p: D = None
        self.r: B = None
        self.t: J = None
        self.x: B = None
        self.z: G = None
        self.w: A = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

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