class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: F = None
        self.q: G = None
        self.u: G = None
        self.w: G = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.y: F = None
        self.o: D = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.t: D = None
        self.s: D = None
        self.q: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.y: F = None
        self.o: D = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.t: D = None
        self.s: D = None
        self.q: D = None
        self.w: E = None
        self.txt = txt

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

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

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