class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.x: H = None
        self.w: H = None
        self.u: G = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: B = None
        self.x: D = None
        self.y: H = None
        self.o: G = None
        self.v: A = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.z: A = None
        self.o: C = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: G = None
        self.q: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: B = None
        self.x: D = None
        self.y: H = None
        self.o: G = None
        self.v: A = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: B = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.z: A = None
        self.o: C = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

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

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

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