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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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