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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: I = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: A = None
        self.y: J = None
        self.t: B = None
        self.q: J = None
        self.s: C = None
        self.w: A = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.w: C = None
        self.r: J = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: G = None
        self.p: C = None
        self.v: J = None
        self.w: I = None
        self.q: I = None
        self.s: B = None
        self.x: J = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: I = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: A = None
        self.y: J = None
        self.t: B = None
        self.q: J = None
        self.s: C = None
        self.w: A = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.w: C = None
        self.r: J = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.u: G = None
        self.p: C = None
        self.v: J = None
        self.w: I = None
        self.q: I = None
        self.s: B = None
        self.x: J = None
        self.r: A = None
        self.txt = txt

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

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

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

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