class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: G = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: A = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: A = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.z: G = None
        self.txt = txt

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

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