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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.r: D = None
        self.p: D = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.r: D = None
        self.y: B = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: A = None
        self.r: D = None
        self.p: D = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.r: D = None
        self.y: B = None
        self.u: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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