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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

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

d = A("d")
a = B("a")
m = C("m")
i = D("i")
k = E("k")
l = F("l")
b = G("b")
c = A("c")
g = F("g")

d.z = g
d.q = g
a.o = b
m.o = c
m.x = a
m.t = d
i.p = a
i.r = l
i.u = d
i.s = b
i.w = c
i.o = c
i.x = k
k.y = i
k.p = a
l.s = c
l.p = i
l.y = k
b.r = l
b.y = a
b.o = k
b.s = m
b.t = m
c.z = l
c.q = g
g.s = d
g.p = i
g.y = k
assert g.p.u.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

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

d = A("d")
a = B("a")
m = C("m")
i = D("i")
k = E("k")
l = F("l")
b = G("b")
c = A("c")
g = F("g")

d.z = g
d.q = g
a.o = b
m.o = c
m.x = a
m.t = d
i.p = a
i.r = l
i.u = d
i.s = b
i.w = c
i.o = c
i.x = k
k.y = i
k.p = a
l.s = c
l.p = i
l.y = k
b.r = l
b.y = a
b.o = k
b.s = m
b.t = m
c.z = l
c.q = g
g.s = d
g.p = i
g.y = k
assert g.p.u.q.s.txt == "d"