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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.q: E = None
        self.s: E = None
        self.p: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.v: A = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

l = A("l")
f = B("f")
a = C("a")
g = D("g")
m = E("m")
d = F("d")
i = G("i")
h = E("h")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.q: E = None
        self.s: E = None
        self.p: A = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.v: A = None
        self.o: C = None
        self.y: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.x: C = None
        self.t: C = None
        self.txt = txt

l = A("l")
f = B("f")
a = C("a")
g = D("g")
m = E("m")
d = F("d")
i = G("i")
h = E("h")

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