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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: A = None
        self.p: E = None
        self.r: C = None
        self.t: B = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

l.p = h
l.z = i
l.w = i
l.s = b
l.u = k
l.x = d
i.s = k
e.r = d
k.x = b
k.q = b
k.s = l
k.p = d
k.r = e
k.t = i
d.q = l
d.w = k
h.q = b
h.z = e
b.z = e
b.q = e
b.r = i
assert k.s.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: B = None
        self.s: G = None
        self.u: D = None
        self.x: E = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: A = None
        self.p: E = None
        self.r: C = None
        self.t: B = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.r: B = None
        self.txt = txt

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

l.p = h
l.z = i
l.w = i
l.s = b
l.u = k
l.x = d
i.s = k
e.r = d
k.x = b
k.q = b
k.s = l
k.p = d
k.r = e
k.t = i
d.q = l
d.w = k
h.q = b
h.z = e
b.z = e
b.q = e
b.r = i
assert k.s.p.q.txt == "b"