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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.txt = txt

c = A("c")
k = B("k")
n = C("n")
b = D("b")
l = E("l")
g = F("g")
i = G("i")
h = B("h")
m = D("m")

c.q = l
c.x = n
c.u = i
k.w = g
k.u = l
k.r = l
k.s = l
k.z = b
n.r = c
n.u = i
b.t = c
l.z = n
l.o = b
l.r = h
g.w = c
g.o = h
i.y = l
i.t = l
h.w = g
h.u = l
h.r = l
h.s = l
h.z = m
m.t = c
assert k.w.w.x.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.txt = txt

c = A("c")
k = B("k")
n = C("n")
b = D("b")
l = E("l")
g = F("g")
i = G("i")
h = B("h")
m = D("m")

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