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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.q: D = None
        self.w: B = None
        self.p: B = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

j = A("j")
k = B("k")
l = C("l")
b = D("b")
e = E("e")
n = F("n")
h = G("h")

j.o = k
j.p = n
k.s = b
k.q = b
k.o = j
k.y = n
k.x = l
l.u = h
l.w = n
l.x = e
b.t = k
b.o = h
b.x = e
e.r = b
e.y = b
e.q = b
e.w = k
e.p = k
e.u = k
e.v = k
n.o = b
h.x = k
h.s = j
assert n.o.x.q.t.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.q: D = None
        self.w: B = None
        self.p: B = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

j = A("j")
k = B("k")
l = C("l")
b = D("b")
e = E("e")
n = F("n")
h = G("h")

j.o = k
j.p = n
k.s = b
k.q = b
k.o = j
k.y = n
k.x = l
l.u = h
l.w = n
l.x = e
b.t = k
b.o = h
b.x = e
e.r = b
e.y = b
e.q = b
e.w = k
e.p = k
e.u = k
e.v = k
n.o = b
h.x = k
h.s = j
assert n.o.x.q.t.o.p.txt == "n"