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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.s: E = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.p: E = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

f = A("f")
k = B("k")
d = C("d")
i = D("i")
n = E("n")
m = F("m")
l = A("l")
a = B("a")
e = E("e")

f.p = d
k.v = i
k.t = i
k.s = e
k.x = a
k.y = a
d.y = n
d.p = n
d.q = m
d.w = a
i.o = e
i.x = l
i.z = f
i.w = d
n.x = e
n.o = i
n.y = m
m.r = i
m.w = l
m.u = l
l.p = d
a.v = i
a.t = i
a.s = n
a.x = k
a.y = k
e.x = n
e.o = i
e.y = m
assert i.x.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.s: E = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: F = None
        self.p: E = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

f = A("f")
k = B("k")
d = C("d")
i = D("i")
n = E("n")
m = F("m")
l = A("l")
a = B("a")
e = E("e")

f.p = d
k.v = i
k.t = i
k.s = e
k.x = a
k.y = a
d.y = n
d.p = n
d.q = m
d.w = a
i.o = e
i.x = l
i.z = f
i.w = d
n.x = e
n.o = i
n.y = m
m.r = i
m.w = l
m.u = l
l.p = d
a.v = i
a.t = i
a.s = n
a.x = k
a.y = k
e.x = n
e.o = i
e.y = m
assert i.x.p.q.txt == "m"