class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: F = None
        self.z: D = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: C = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

b = A("b")
f = B("f")
l = C("l")
h = D("h")
g = E("g")
m = F("m")
j = D("j")
d = E("d")
k = B("k")

b.x = l
b.o = l
b.s = m
b.u = m
b.z = h
f.q = h
l.v = m
l.s = m
l.o = b
l.u = h
h.w = l
g.x = j
g.q = k
g.r = d
m.x = f
m.z = f
m.q = l
m.y = l
j.w = l
d.x = j
d.q = f
d.r = g
k.q = h
assert k.q.w.o.z.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: F = None
        self.z: D = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: C = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

b = A("b")
f = B("f")
l = C("l")
h = D("h")
g = E("g")
m = F("m")
j = D("j")
d = E("d")
k = B("k")

b.x = l
b.o = l
b.s = m
b.u = m
b.z = h
f.q = h
l.v = m
l.s = m
l.o = b
l.u = h
h.w = l
g.x = j
g.q = k
g.r = d
m.x = f
m.z = f
m.q = l
m.y = l
j.w = l
d.x = j
d.q = f
d.r = g
k.q = h
assert k.q.w.o.z.w.u.txt == "h"