class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.v: A = None
        self.r: F = None
        self.u: D = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.q: D = None
        self.u: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: E = None
        self.y: E = None
        self.p: C = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.s: E = None
        self.x: D = None
        self.t: E = None
        self.o: C = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

h = A("h")
c = B("c")
g = C("g")
f = D("f")
l = E("l")
j = F("j")
k = G("k")
b = F("b")
e = B("e")
d = A("d")

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: A = None
        self.q: D = None
        self.u: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: E = None
        self.y: E = None
        self.p: C = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.s: E = None
        self.x: D = None
        self.t: E = None
        self.o: C = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

h = A("h")
c = B("c")
g = C("g")
f = D("f")
l = E("l")
j = F("j")
k = G("k")
b = F("b")
e = B("e")
d = A("d")

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