class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.y: E = None
        self.q: B = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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