class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.txt = txt

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

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

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

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