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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

c = A("c")
g = B("g")
a = C("a")
i = D("i")
n = E("n")
m = F("m")
k = G("k")
h = D("h")

c.t = i
g.y = k
g.u = k
g.v = m
g.s = m
a.o = m
a.r = g
i.p = a
i.u = m
i.v = n
n.y = i
n.o = m
m.x = k
m.u = n
m.s = g
k.v = m
h.p = a
h.u = m
h.v = n
assert h.u.s.u.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: E = None
        self.s: B = None
        self.txt = txt

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

c = A("c")
g = B("g")
a = C("a")
i = D("i")
n = E("n")
m = F("m")
k = G("k")
h = D("h")

c.t = i
g.y = k
g.u = k
g.v = m
g.s = m
a.o = m
a.r = g
i.p = a
i.u = m
i.v = n
n.y = i
n.o = m
m.x = k
m.u = n
m.s = g
k.v = m
h.p = a
h.u = m
h.v = n
assert h.u.s.u.v.x.txt == "k"