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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

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

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

i.q = b
i.y = b
i.p = h
i.u = h
i.w = n
n.w = b
n.r = i
j.q = i
l.u = j
l.t = h
l.y = i
b.w = n
b.x = n
b.y = h
b.t = h
h.q = n
h.x = j
h.t = b
h.w = b
assert h.x.q.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: F = None
        self.u: F = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

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

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

i.q = b
i.y = b
i.p = h
i.u = h
i.w = n
n.w = b
n.r = i
j.q = i
l.u = j
l.t = h
l.y = i
b.w = n
b.x = n
b.y = h
b.t = h
h.q = n
h.x = j
h.t = b
h.w = b
assert h.x.q.w.w.txt == "b"