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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.z: B = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.txt = txt

f = A("f")
m = B("m")
e = C("e")
k = D("k")
l = E("l")
c = F("c")
h = G("h")
g = H("g")

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.z: B = None
        self.y: F = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: H = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.txt = txt

f = A("f")
m = B("m")
e = C("e")
k = D("k")
l = E("l")
c = F("c")
h = G("h")
g = H("g")

f.t = c
f.r = l
f.y = e
m.p = h
m.y = h
m.r = l
e.o = m
e.z = m
e.t = m
e.w = k
e.y = c
k.s = c
k.z = c
k.r = h
k.u = m
k.q = g
l.r = e
c.s = f
c.t = g
c.z = g
c.x = h
h.q = m
g.p = m
g.y = m
assert h.q.r.r.w.u.r.r.w.txt == "k"