class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: G = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.x: D = None
        self.q: G = None
        self.w: G = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.x: D = None
        self.q: G = None
        self.w: G = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

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