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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

c.v = f
c.o = e
c.t = e
c.q = i
i.q = d
i.u = c
i.r = c
e.z = f
e.t = i
a.t = i
a.p = c
a.z = e
d.u = i
d.o = i
d.v = a
d.p = a
d.x = m
d.t = e
f.w = e
f.p = d
f.z = a
f.r = a
m.t = i
m.p = c
m.z = e
assert d.x.p.v.txt == "f"