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

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

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

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

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

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

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

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

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

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

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

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

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

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

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