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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.r: A = None
        self.o: B = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.q: H = None
        self.u: H = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: B = None
        self.x: E = None
        self.s: B = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.r: A = None
        self.o: B = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: H = None
        self.q: H = None
        self.u: H = None
        self.r: C = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: B = None
        self.x: E = None
        self.s: B = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.p: D = None
        self.y: B = None
        self.txt = txt

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

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