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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.v: B = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.v: B = None
        self.t: C = None
        self.w: A = None
        self.txt = txt

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

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

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