class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.o: B = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.o: C = None
        self.txt = txt

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

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

g.u = h
g.s = h
g.v = f
g.o = i
g.p = b
i.x = k
i.u = k
b.s = g
b.x = k
b.q = i
h.p = f
h.y = f
h.v = k
f.w = g
f.u = n
f.o = b
n.u = f
n.q = f
n.p = i
n.w = k
k.s = g
k.x = b
k.q = i
assert h.v.q.u.q.u.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: E = None
        self.o: B = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.o: C = None
        self.txt = txt

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

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

g.u = h
g.s = h
g.v = f
g.o = i
g.p = b
i.x = k
i.u = k
b.s = g
b.x = k
b.q = i
h.p = f
h.y = f
h.v = k
f.w = g
f.u = n
f.o = b
n.u = f
n.q = f
n.p = i
n.w = k
k.s = g
k.x = b
k.q = i
assert h.v.q.u.q.u.q.x.txt == "k"