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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.t: E = None
        self.r: G = None
        self.txt = txt

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

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

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