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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.s: B = None
        self.q: A = None
        self.p: C = None
        self.v: F = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.s: B = None
        self.q: A = None
        self.p: C = None
        self.v: F = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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