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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: F = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.v: C = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

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

a.w = k
a.y = f
a.o = g
a.r = b
a.u = b
m.v = k
m.x = j
m.t = h
h.p = k
h.y = m
k.w = f
k.s = m
k.v = h
k.q = j
f.q = j
f.y = m
g.s = h
g.y = f
g.q = k
b.w = k
b.y = f
b.o = j
b.r = a
b.u = a
j.s = h
j.y = f
j.q = k
assert g.y.q.y.q.q.w.q.y.txt == "f"