class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: C = None
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.txt = txt

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

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