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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.y: D = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.w: A = None
        self.t: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: D = None
        self.z: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.y: D = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.w: A = None
        self.t: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: D = None
        self.z: G = None
        self.o: G = None
        self.txt = txt

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

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

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