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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.w: A = None
        self.x: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: G = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: A = None
        self.v: H = None
        self.x: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.w: A = None
        self.x: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: G = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: A = None
        self.v: H = None
        self.x: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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