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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: H = None
        self.q: F = None
        self.v: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: H = None
        self.q: F = None
        self.v: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

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

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

g.v = l
g.x = n
g.y = n
c.u = j
c.x = l
c.q = h
c.v = h
c.s = i
n.p = l
n.t = g
d.u = j
d.v = c
d.x = n
b.p = c
b.v = l
h.v = g
h.y = g
h.o = g
h.w = g
h.t = d
i.q = c
i.t = g
i.p = g
i.x = h
i.w = h
j.t = d
j.q = i
l.t = d
l.q = i
assert c.v.t.v.q.txt == "h"