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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.x: E = None
        self.r: B = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

c = A("c")
i = B("i")
k = C("k")
h = D("h")
m = E("m")
b = F("b")
e = D("e")
j = B("j")
f = F("f")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: A = None
        self.x: E = None
        self.r: B = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

c = A("c")
i = B("i")
k = C("k")
h = D("h")
m = E("m")
b = F("b")
e = D("e")
j = B("j")
f = F("f")

c.q = i
c.t = m
i.x = c
i.z = m
i.t = h
k.q = c
k.y = c
k.p = m
k.t = j
k.s = b
h.z = m
h.v = i
h.p = k
m.q = e
b.q = i
b.z = c
b.x = m
b.r = j
b.t = f
b.v = f
e.z = m
e.v = i
e.p = k
j.x = c
j.z = m
j.t = e
f.q = i
f.z = c
f.x = m
f.r = j
f.t = b
f.v = b
assert f.q.t.z.txt == "m"