class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: E = None
        self.x: B = None
        self.r: C = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: G = None
        self.q: E = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: G = None
        self.q: E = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.txt = txt

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

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