class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.p: D = None
        self.v: G = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.q: D = None
        self.u: A = None
        self.x: F = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.q: D = None
        self.u: A = None
        self.x: F = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

e.y = f
e.s = h
e.p = h
e.v = i
e.q = g
b.w = g
b.s = n
b.z = n
j.v = b
h.z = n
h.v = e
n.o = b
n.r = h
f.q = e
f.z = h
i.s = j
i.w = h
i.q = h
i.u = e
i.o = e
i.v = e
i.x = f
k.v = b
g.s = j
g.w = h
g.q = h
g.u = e
g.o = e
g.v = e
g.x = f
assert j.v.w.u.q.w.txt == "h"