class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: F = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.r: H = None
        self.p: H = None
        self.q: C = None
        self.s: B = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.r: H = None
        self.p: H = None
        self.q: C = None
        self.s: B = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

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

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

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