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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
h = C("h")
n = D("n")
f = E("f")
j = F("j")
g = C("g")

c.v = h
k.t = h
k.w = j
k.v = n
h.o = c
h.u = c
h.r = k
h.v = g
h.s = j
h.x = n
n.v = k
f.w = n
j.t = c
g.o = c
g.u = c
g.r = k
g.v = h
g.s = j
g.x = n
assert g.v.s.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
h = C("h")
n = D("n")
f = E("f")
j = F("j")
g = C("g")

c.v = h
k.t = h
k.w = j
k.v = n
h.o = c
h.u = c
h.r = k
h.v = g
h.s = j
h.x = n
n.v = k
f.w = n
j.t = c
g.o = c
g.u = c
g.r = k
g.v = h
g.s = j
g.x = n
assert g.v.s.t.v.x.txt == "n"