class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

g.s = h
e.x = h
e.v = h
e.s = h
e.u = k
e.o = d
e.r = d
e.w = g
l.t = h
l.r = h
l.w = e
l.o = d
h.w = d
h.z = l
h.v = k
h.x = g
m.t = k
m.z = k
m.r = k
m.u = g
m.q = g
m.v = h
m.w = d
d.v = l
k.w = g
assert g.s.v.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

g.s = h
e.x = h
e.v = h
e.s = h
e.u = k
e.o = d
e.r = d
e.w = g
l.t = h
l.r = h
l.w = e
l.o = d
h.w = d
h.z = l
h.v = k
h.x = g
m.t = k
m.z = k
m.r = k
m.u = g
m.q = g
m.v = h
m.w = d
d.v = l
k.w = g
assert g.s.v.w.s.txt == "h"