class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.x: C = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.w: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.u: B = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.s: A = None
        self.o: D = None
        self.r: F = None
        self.t: B = None
        self.txt = txt

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

h.w = c
h.v = k
h.x = l
h.p = b
h.s = b
d.u = k
d.y = m
d.w = l
d.p = f
l.r = k
l.s = k
l.w = f
l.t = d
m.r = c
m.s = k
m.v = k
m.u = d
m.y = b
f.x = d
b.o = m
k.u = m
k.o = m
k.x = f
k.s = c
k.r = b
k.t = d
c.w = h
c.v = k
c.x = l
c.p = b
c.s = b
assert d.u.r.o.u.y.r.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.x: C = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.w: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.u: B = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.s: A = None
        self.o: D = None
        self.r: F = None
        self.t: B = None
        self.txt = txt

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

h.w = c
h.v = k
h.x = l
h.p = b
h.s = b
d.u = k
d.y = m
d.w = l
d.p = f
l.r = k
l.s = k
l.w = f
l.t = d
m.r = c
m.s = k
m.v = k
m.u = d
m.y = b
f.x = d
b.o = m
k.u = m
k.o = m
k.x = f
k.s = c
k.r = b
k.t = d
c.w = h
c.v = k
c.x = l
c.p = b
c.s = b
assert d.u.r.o.u.y.r.w.w.txt == "c"