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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: E = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: E = None
        self.t: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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