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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: E = None
        self.v: A = None
        self.x: G = None
        self.s: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: E = None
        self.v: A = None
        self.x: G = None
        self.s: C = None
        self.r: G = None
        self.txt = txt

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

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

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