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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.r: A = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
a = C("a")
c = D("c")
i = E("i")
j = F("j")
h = A("h")

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.r: A = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
a = C("a")
c = D("c")
i = E("i")
j = F("j")
h = A("h")

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