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

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

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

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

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

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

c = A("c")
h = B("h")
i = C("i")
j = D("j")
d = E("d")
k = F("k")

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

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

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

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

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

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

c = A("c")
h = B("h")
i = C("i")
j = D("j")
d = E("d")
k = F("k")

c.q = h
c.y = j
c.x = j
c.o = j
h.p = k
i.s = k
i.y = k
i.q = k
i.o = d
i.r = j
i.t = j
j.r = h
j.z = d
d.t = j
d.y = h
d.r = k
d.x = k
d.z = k
d.s = i
k.z = c
k.w = c
k.q = h
k.v = h
k.y = j
assert d.x.w.q.p.txt == "k"