class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: H = None
        self.p: D = None
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: J = None
        self.u: F = None
        self.q: F = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: J = None
        self.u: F = None
        self.q: F = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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