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

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

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

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

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

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

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

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

e.q = g
e.x = b
l.t = b
l.r = g
l.w = h
c.z = l
c.o = e
h.r = l
h.q = n
h.p = n
h.x = g
h.u = c
h.y = b
h.o = k
g.z = c
n.o = b
n.q = e
b.o = e
b.p = e
b.r = n
b.w = c
b.u = k
b.y = l
b.t = l
k.r = l
k.q = n
k.p = n
k.x = g
k.u = c
k.y = b
k.o = h
assert h.o.p.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

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