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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.u: F = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: F = None
        self.u: F = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

f.v = i
f.r = a
f.y = k
f.z = m
f.o = m
g.o = i
g.s = i
g.z = i
g.y = b
i.w = m
i.p = m
i.y = a
i.u = a
i.o = b
b.w = n
b.q = n
b.u = m
m.o = a
m.y = a
a.q = m
a.r = f
a.u = f
a.o = i
n.v = i
n.r = a
n.y = k
n.z = m
n.o = m
k.o = i
k.s = i
k.z = i
k.y = b
assert f.r.o.w.y.r.txt == "f"