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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.s: D = None
        self.q: D = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.s: D = None
        self.q: D = None
        self.t: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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