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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.p: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.z: E = None
        self.y: E = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: E = None
        self.p: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: B = None
        self.z: E = None
        self.y: E = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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