class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: E = None
        self.z: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: B = None
        self.o: A = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: B = None
        self.o: A = None
        self.t: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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