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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.q: F = None
        self.r: B = None
        self.z: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.s: B = None
        self.z: E = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.q: F = None
        self.r: B = None
        self.z: F = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.s: B = None
        self.z: E = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: E = None
        self.txt = txt

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

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

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