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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.w: G = None
        self.u: E = None
        self.z: F = None
        self.y: B = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.r: E = None
        self.s: B = None
        self.y: A = None
        self.p: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.q: C = None
        self.p: F = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

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

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

a.u = b
a.y = i
a.p = d
a.q = d
a.o = l
a.w = j
a.t = c
b.r = j
b.y = l
b.q = d
b.t = c
j.s = d
j.v = d
j.u = d
j.w = c
j.x = c
j.z = l
j.y = b
i.t = j
i.z = j
i.q = a
i.y = a
i.r = d
i.s = b
i.p = b
d.o = a
d.y = b
d.x = b
d.q = j
d.v = j
d.p = l
l.w = a
l.x = d
l.o = c
l.u = i
c.q = d
assert l.x.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.p: E = None
        self.o: F = None
        self.w: C = None
        self.t: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.w: G = None
        self.u: E = None
        self.z: F = None
        self.y: B = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.r: E = None
        self.s: B = None
        self.y: A = None
        self.p: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: B = None
        self.q: C = None
        self.p: F = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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