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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.u: F = None
        self.z: F = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

b = A("b")
k = B("k")
d = C("d")
m = D("m")
i = E("i")
e = F("e")
g = F("g")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.u: F = None
        self.z: F = None
        self.s: B = None
        self.o: D = None
        self.txt = txt

b = A("b")
k = B("k")
d = C("d")
m = D("m")
i = E("i")
e = F("e")
g = F("g")

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