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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: A = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

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

i.v = k
m.p = i
m.w = h
m.s = j
c.y = j
c.x = m
j.t = l
n.z = j
n.s = k
n.w = c
n.x = h
h.y = g
h.v = i
h.o = n
h.r = k
k.p = i
k.w = h
k.s = j
l.y = j
l.x = m
g.p = i
g.w = h
g.s = j
assert c.y.t.y.t.y.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: A = None
        self.o: E = None
        self.r: B = None
        self.txt = txt

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

i.v = k
m.p = i
m.w = h
m.s = j
c.y = j
c.x = m
j.t = l
n.z = j
n.s = k
n.w = c
n.x = h
h.y = g
h.v = i
h.o = n
h.r = k
k.p = i
k.w = h
k.s = j
l.y = j
l.x = m
g.p = i
g.w = h
g.s = j
assert c.y.t.y.t.y.t.x.txt == "m"