class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.z: H = None
        self.x: D = None
        self.s: G = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: I = None
        self.u: A = None
        self.p: E = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

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

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

f.u = b
f.x = k
c.p = k
c.o = e
k.r = e
k.u = e
k.s = e
k.z = b
k.x = g
k.t = f
g.r = l
g.y = l
g.x = j
g.u = f
g.s = f
g.p = i
i.r = b
i.z = c
i.q = c
i.t = f
i.s = l
i.p = a
i.y = e
l.o = c
l.p = j
e.y = l
e.t = g
a.r = e
a.z = e
a.y = j
a.t = l
a.w = l
a.o = l
a.s = c
a.q = g
j.x = e
j.q = e
b.r = e
b.z = e
b.y = j
b.t = l
b.w = l
b.o = l
b.s = c
b.q = g
assert f.x.s.t.y.p.q.y.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: G = None
        self.z: H = None
        self.x: D = None
        self.s: G = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: I = None
        self.u: A = None
        self.p: E = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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