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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.u: F = None
        self.q: F = None
        self.z: F = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.x: A = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.u: F = None
        self.q: F = None
        self.z: F = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.x: A = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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