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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.q: A = None
        self.o: D = None
        self.s: G = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

j = A("j")
l = B("l")
g = C("g")
i = D("i")
n = E("n")
f = F("f")
k = G("k")

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.q: A = None
        self.o: D = None
        self.s: G = None
        self.u: E = None
        self.r: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: B = None
        self.txt = txt

j = A("j")
l = B("l")
g = C("g")
i = D("i")
n = E("n")
f = F("f")
k = G("k")

j.s = g
l.y = f
l.w = j
l.q = j
l.r = j
l.o = i
l.s = k
l.u = n
g.r = l
g.t = l
g.x = i
g.y = i
g.p = n
g.w = f
i.p = n
i.q = n
i.o = n
i.u = n
i.s = f
i.y = l
i.x = j
n.p = k
n.t = f
n.u = f
f.p = g
f.y = j
f.t = j
f.u = i
f.s = i
k.t = j
k.q = l
assert f.t.s.r.u.p.q.o.txt == "i"