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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: H = None
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: F = None
        self.r: F = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: A = None
        self.q: H = None
        self.t: A = None
        self.w: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: H = None
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: F = None
        self.r: F = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: A = None
        self.q: H = None
        self.t: A = None
        self.w: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.txt = txt

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

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