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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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