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

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

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

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

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

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

j = A("j")
d = B("d")
k = C("k")
i = D("i")
a = E("a")
l = F("l")
n = D("n")
h = E("h")

j.r = h
j.q = h
j.p = l
j.t = l
d.s = k
k.t = h
i.t = j
a.o = d
l.u = j
l.p = i
l.o = n
n.t = j
h.o = d
assert i.t.q.o.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: F = None
        self.q: E = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
d = B("d")
k = C("k")
i = D("i")
a = E("a")
l = F("l")
n = D("n")
h = E("h")

j.r = h
j.q = h
j.p = l
j.t = l
d.s = k
k.t = h
i.t = j
a.o = d
l.u = j
l.p = i
l.o = n
n.t = j
h.o = d
assert i.t.q.o.s.t.txt == "h"