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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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