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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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