class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.u: F = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: E = None
        self.txt = txt

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

b.q = a
b.u = a
b.s = g
b.w = f
b.p = f
k.v = g
k.x = e
f.x = n
f.u = b
f.t = k
g.w = a
g.r = n
n.s = h
n.u = g
n.w = g
n.p = e
n.t = f
n.y = a
a.v = b
a.y = n
h.q = a
h.u = a
h.s = g
h.w = f
h.p = f
e.v = g
e.x = k
assert b.s.w.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.u: F = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: E = None
        self.txt = txt

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

b.q = a
b.u = a
b.s = g
b.w = f
b.p = f
k.v = g
k.x = e
f.x = n
f.u = b
f.t = k
g.w = a
g.r = n
n.s = h
n.u = g
n.w = g
n.p = e
n.t = f
n.y = a
a.v = b
a.y = n
h.q = a
h.u = a
h.s = g
h.w = f
h.p = f
e.v = g
e.x = k
assert b.s.w.v.u.txt == "a"