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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.y: A = None
        self.r: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.q: C = None
        self.o: D = None
        self.s: F = None
        self.t: C = None
        self.y: G = None
        self.z: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: D = None
        self.w: H = None
        self.o: I = None
        self.z: I = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.o: A = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.y: A = None
        self.r: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: H = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.q: C = None
        self.o: D = None
        self.s: F = None
        self.t: C = None
        self.y: G = None
        self.z: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: D = None
        self.w: H = None
        self.o: I = None
        self.z: I = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.o: A = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

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

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