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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.x: D = None
        self.z: D = None
        self.p: B = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.u: C = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.x: D = None
        self.z: D = None
        self.p: B = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: B = None
        self.u: C = None
        self.o: A = None
        self.txt = txt

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

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