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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: I = None
        self.y: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: F = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: I = None
        self.y: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: F = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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