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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: C = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

f.s = a
f.x = i
d.z = a
d.x = e
d.r = e
d.q = i
d.v = k
c.t = b
c.q = i
k.r = e
i.q = b
i.u = b
i.s = j
b.v = d
b.s = j
b.r = k
a.s = f
a.x = i
h.t = b
h.q = i
j.r = e
e.t = b
e.q = i
assert i.s.r.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.r: C = None
        self.q: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

f.s = a
f.x = i
d.z = a
d.x = e
d.r = e
d.q = i
d.v = k
c.t = b
c.q = i
k.r = e
i.q = b
i.u = b
i.s = j
b.v = d
b.s = j
b.r = k
a.s = f
a.x = i
h.t = b
h.q = i
j.r = e
e.t = b
e.q = i
assert i.s.r.t.r.txt == "k"