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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.t: G = None
        self.p: B = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.v: C = None
        self.q: D = None
        self.x: C = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.y: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

b = A("b")
h = B("h")
m = C("m")
i = D("i")
d = E("d")
l = F("l")
g = G("g")
e = E("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.t: G = None
        self.p: B = None
        self.o: G = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.v: C = None
        self.q: D = None
        self.x: C = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.y: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

b = A("b")
h = B("h")
m = C("m")
i = D("i")
d = E("d")
l = F("l")
g = G("g")
e = E("e")

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