class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: H = None
        self.z: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.s: I = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: H = None
        self.v: H = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.s: I = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: H = None
        self.v: H = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: J = None
        self.txt = txt

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

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

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

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