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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.u: B = None
        self.y: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

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

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

i = A("i")
g = B("g")
j = C("j")
n = D("n")
k = E("k")
b = F("b")
h = A("h")

i.q = h
i.r = h
i.w = g
i.z = b
g.o = n
g.v = j
j.w = k
j.z = k
j.u = g
j.y = b
j.t = b
j.x = i
n.w = k
k.y = b
k.w = n
k.q = n
b.x = g
b.q = i
b.s = i
b.u = k
b.v = h
h.q = i
h.r = i
h.w = g
h.z = b
assert j.u.o.w.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: B = None
        self.z: F = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.u: B = None
        self.y: F = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

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

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

i = A("i")
g = B("g")
j = C("j")
n = D("n")
k = E("k")
b = F("b")
h = A("h")

i.q = h
i.r = h
i.w = g
i.z = b
g.o = n
g.v = j
j.w = k
j.z = k
j.u = g
j.y = b
j.t = b
j.x = i
n.w = k
k.y = b
k.w = n
k.q = n
b.x = g
b.q = i
b.s = i
b.u = k
b.v = h
h.q = i
h.r = i
h.w = g
h.z = b
assert j.u.o.w.q.w.txt == "k"