class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.t: H = None
        self.w: H = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: H = None
        self.w: G = None
        self.t: E = None
        self.x: E = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: H = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

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

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

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

a.v = n
a.x = e
a.t = c
a.w = c
a.z = b
b.p = n
b.t = n
b.s = d
b.w = d
b.z = d
b.u = a
b.o = j
e.z = j
e.r = c
e.w = g
e.t = d
e.x = d
e.y = f
n.w = d
n.y = d
d.v = b
d.s = g
d.p = c
d.r = e
l.x = f
l.v = c
l.z = g
l.p = n
g.x = j
c.s = g
j.x = f
j.v = c
j.z = g
j.p = n
f.p = n
f.t = n
f.s = d
f.w = d
f.z = d
f.u = a
f.o = l
assert n.w.s.x.p.y.v.o.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: C = None
        self.t: H = None
        self.w: H = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: H = None
        self.w: G = None
        self.t: E = None
        self.x: E = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: G = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: H = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

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

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

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

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