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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.y: D = None
        self.r: A = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.y: D = None
        self.r: A = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

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

k.u = g
k.v = g
k.t = m
d.u = k
b.w = d
l.s = b
l.t = g
h.p = d
h.u = d
h.w = m
h.s = m
h.y = l
h.z = b
m.s = k
m.v = d
g.u = b
g.v = l
g.y = l
g.t = l
g.r = k
g.o = h
assert h.y.t.o.y.s.txt == "b"