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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: G = None
        self.q: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.v: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: G = None
        self.q: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.v: F = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c.w = e
c.u = e
c.x = b
d.t = c
d.s = a
d.y = h
d.q = e
e.w = a
e.r = n
e.q = b
e.s = c
l.o = c
l.z = n
l.v = a
l.y = d
b.o = c
b.x = a
a.p = c
a.t = e
n.u = a
n.z = c
h.u = a
h.z = c
assert e.r.z.x.x.txt == "a"