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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
e = D("e")
h = E("h")
i = F("i")
m = F("m")
g = B("g")
k = C("k")

d.s = n
d.u = e
n.q = h
n.t = i
n.z = e
b.q = e
b.p = d
b.s = d
e.z = g
e.q = n
h.v = g
h.t = e
h.o = e
i.w = d
i.u = k
i.y = g
i.t = b
m.w = d
m.u = b
m.y = n
m.t = k
g.q = h
g.t = i
g.z = e
k.q = e
k.p = d
k.s = d
assert b.s.s.q.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

d = A("d")
n = B("n")
b = C("b")
e = D("e")
h = E("h")
i = F("i")
m = F("m")
g = B("g")
k = C("k")

d.s = n
d.u = e
n.q = h
n.t = i
n.z = e
b.q = e
b.p = d
b.s = d
e.z = g
e.q = n
h.v = g
h.t = e
h.o = e
i.w = d
i.u = k
i.y = g
i.t = b
m.w = d
m.u = b
m.y = n
m.t = k
g.q = h
g.t = i
g.z = e
k.q = e
k.p = d
k.s = d
assert b.s.s.q.v.t.txt == "i"