class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.t: G = None
        self.z: C = None
        self.o: C = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

e = A("e")
j = B("j")
n = C("n")
a = D("a")
h = E("h")
l = F("l")
c = G("c")
g = H("g")

e.v = h
e.r = a
e.s = a
e.t = c
e.q = c
e.z = n
e.o = n
j.x = a
j.s = a
j.u = h
n.v = h
n.s = l
n.r = g
a.v = e
a.y = e
a.x = l
a.z = l
a.r = c
h.y = n
l.o = n
c.t = l
g.q = e
assert g.q.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.t: G = None
        self.z: C = None
        self.o: C = None
        self.q: G = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

e = A("e")
j = B("j")
n = C("n")
a = D("a")
h = E("h")
l = F("l")
c = G("c")
g = H("g")

e.v = h
e.r = a
e.s = a
e.t = c
e.q = c
e.z = n
e.o = n
j.x = a
j.s = a
j.u = h
n.v = h
n.s = l
n.r = g
a.v = e
a.y = e
a.x = l
a.z = l
a.r = c
h.y = n
l.o = n
c.t = l
g.q = e
assert g.q.v.y.v.txt == "h"