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

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

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

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

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

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

e = A("e")
a = B("a")
j = C("j")
m = D("m")
i = E("i")
g = F("g")
h = B("h")

e.o = j
e.u = a
e.t = m
a.s = m
a.t = g
a.o = g
a.y = h
j.v = i
j.y = a
j.x = a
j.t = h
m.r = j
m.w = j
i.r = m
i.s = j
i.q = h
g.t = m
h.s = m
h.t = g
h.o = g
h.y = a
assert g.t.r.t.y.y.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

e = A("e")
a = B("a")
j = C("j")
m = D("m")
i = E("i")
g = F("g")
h = B("h")

e.o = j
e.u = a
e.t = m
a.s = m
a.t = g
a.o = g
a.y = h
j.v = i
j.y = a
j.x = a
j.t = h
m.r = j
m.w = j
i.r = m
i.s = j
i.q = h
g.t = m
h.s = m
h.t = g
h.o = g
h.y = a
assert g.t.r.t.y.y.s.r.txt == "j"